<@admin.header title="选择测评师">

<style>
	.imglist img {
		width: 120px;
		height: 180px;
		}	
	.imglist li {
		width:146px;
		height:218px;
		text-align:center;
	}
</style>
</@admin.header>
    <body style="min-width:550px;">
        <div class="rightinfo" >
        	<div class="formbody">
		        <div class="formtitle">
		            <span>选择测评师</span>
		        </div>
			<!--	<ul class="forminfo">
		            <li>
		            	<input type="hidden" id="startId" value="0" />
		                <label class="field" style="width:140px;">名称</label>
		                <input id="keyword" type="text" class="dfinput" onkeyup="javascript:if(event.keyCode==13) search();"/>
						<button class="btn" onclick="search();">搜索</button>
		            </li>
				</ul>-->
			</div>
        	<!--默认查询表单-->
			 <ul class="imglist">
            	<span id="contact_body" style="max-height:500px;overflow-y:auto;">
                </span>
            </ul>
			
			<div class="clear"></div>
			<div class="xline"></div>
			<div style="text-align:center;margin-top:10px;">
				<button class="btn" onclick="cancel();">关闭窗口</button>
			</div>
        </div>
    </body>
	<script>
	var keyword = "";
	var form = new App.common.form();
	var ajax = new App.common.ajax();
	var dialog = new App.common.dialog();
	var selecIds = "${id!''}";
	
	function toggle(o){form.checkToggle('contact',o);}
	$(document).ready(function(){
		loadMore();
	});
	function search(){
		keyword =$("#keyword").val();
		$("#startId").val('0');
		$("#contact_body").html("");
		loadMore();
	}	
	
	function loadMore(){
		var startId = $("#startId").val();
		ajax.post("car/evaluators/select.do",{"totalCount":startId,"keyword":keyword},null,function(e){
			if(App.isEmpty(e)){
				dialog.alert("没有更多了");				
			}else{
				$('#contact_body').append(e);
				$("#startId").val($("#contact_body tr:last").attr("cid"));
				
				configSelect();
			}
		});
	}
	
	function configSelect(){
		$("input[pass='0']").each(function(){
			if(selecIds.indexOf($(this).val()+";")>-1)
				this.checked=true;
			$(this).attr("pass",1);
		});
	}
	
	function cancel(){
		dialog.confirm("确定关闭窗口吗？",function(){
			window.close();
		});
	}
	
	function select (id, name, title){
	    opener.${func}(id, name, title);    //调用父窗口的指定函数，函数是可以自定义的
	    window.close();   //关闭当前窗口
	}
	</script>
</html>